The getErrors method returns an array of error strings sent by trading broker.
var getErrors();
This method returns an array of string objects.
The following example demonstrates the use getErrors() method.
function onOrder(account, order, orderResults)
{
//check to see if there are errors in orderResults object
if(orderResults.length > 0)
{
//print all errors to debug console
for(var i = 0; i < orderResults.lengh; i++)
{
Debug.writeLine("error: " + orderResults[i]);
}
//because we had errors, do not proceed...
return;
}
//if order was a limit order, cancel it
if(order.getOrderType() == ORDERTYPE_LIMIT)
{
account.placeOrderCancel(order);
}
}
Copyright © 2006-2009 ActiveTick LLC